<template>
	<div class="easyd-weixin-Box">

		<div class="app_page_box" style="bottom: 50px;">
			<div class="app_page">
				<div class="app_list_box MARGIN_BOTTOM_10">

					<div class="history_follow_info">
						<div class="app_box_content_textarea">
							<textarea maxlength="1000" name="" rows="8" v-model="serviceQuick.name" cols=""></textarea>
							<span>0/1000</span>
						</div>
					</div>

					<div class="app_box_content">
						<div class="app_box_content_right" @click="serverQuick()">
							快捷服务
							<span class="fa fa-angle-right fa-lg"></span>
						</div>
					</div>

				</div>
				
				<div class="app_list_box MARGIN_BOTTOM_10">
					<div class="app_box_content">
						<div class="app_box_content_left">
							跟进方式
						</div>
						<div class="app_box_content_right" @click="selectFollowType()">
							<span class="C4">{{serviceType.name == undefined ? serviceType : serviceType.name}}</span>
							<i class="fa fa-angle-right fa-lg"></i>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="app_bottom_box" @click="submit()">
			<div class="app_bottom_box_right">
				提交
			</div>
		</div>

	</div>
</template>

<script>
	import { mapState, mapMutations } from "vuex";
	export default {

		data() {
			return {

			};
		},
		computed: {
			...mapState({
                serviceType: state => state.AddServiceModule.serviceType,
                serviceQuick: state => state.AddServiceModule.serviceQuick,
			})
		},
		mounted() {
			console.log(this.serviceType.name)
			console.log(this.serviceQuick)
		},
		methods: {

			//  ...mapMutations(["ShopIndexModule/updateIsShopGuide"]),

			submit() {

                var param = {
                    c_id: this.$route.query.customerId,
                    cs_uid: this.$userData.getUID(),
                    cs_content: this.serviceQuick.name,
                    cs_way: this.serviceType.id,
                };

                console.log(param);
//                 return;
                this.$easyUtil.startLoading(this)
                this.$http.postHttp(this.$API.addingCustomerServicedRecords, param, (rs) => {

                    this.$easyUtil.endLoading(this)
                    this.$easyUtil.successToast(this, '跟进服务成功');
                    this.$store.commit('AddFollowModule/clearServiceData');
                    history.go(-1);

                })
			},

			serverQuick(e) {
                this.$easyUtil.GO(this, '/serverQuick');
			},
            selectFollowType(e) {
                this.$easyUtil.GO(this, '/followType',{'type':'service'});
            },
		}
	};
</script>

<style lang="stylus" scoped>
	@import '~PUBLIC_CSS';
	.history_follow_info {
		padding: 10px;
		border-bottom: 1px solid #f1f1f1;
	}
	
	.history_follow_info .app_box_content_textarea {
		padding: 0;
		position: relative;
	}
	
	.history_follow_info .app_box_content_textarea textarea {
		background: #F4F4F4;
		padding: 10px;
	}
	
	.history_follow_info .app_box_content_textarea span{
		position: absolute;
		right: 1px;
		bottom: 1px;
		font-size: small;
		color: #999;
		background: #f4f4f4;
		padding: 5px;
	}
	
</style>